home *** CD-ROM | disk | FTP | other *** search
/ Amiga Magazin: Amiga-CD 1997 September & October / Amiga-CD 1997 #9-10.iso / software / arteffect2.demo / rexx / shadow.rexx < prev    next >
OS/2 REXX Batch file  |  1997-04-12  |  1KB  |  58 lines

  1. /*
  2.     Cast Shadow
  3.     Copyright © 1997 by A. Pratsch
  4.  
  5.     - You need a transparent layer. Paint something onto it (e.g. a ball
  6.         or a text)
  7.  
  8.     - Then call this script. It will create a shadowmap for your object
  9.         and then applies it to your painting.
  10.  
  11.     example for the following rexx commands of arteffect: layer,
  12.     createbrush, setcolor, changebrush, circle and rectangle.
  13. */
  14.  
  15. options results
  16.  
  17. address "ArtEffect"
  18.  
  19. layer stem a.
  20. say "Active layer: " || a.active
  21. say "Number of layers: " || a.number
  22.  
  23. if a.number <= 2 then
  24. do
  25.     createbrush frompicture
  26.     if rc~=0 then say rc2
  27.     layer append opacity 60 name 'Shadow'
  28.     if rc~=0 then say rc2
  29.  
  30.     if a.number = 1 then
  31.         layer moveto 0
  32.     else
  33.         layer moveto 1
  34.  
  35.     setcolor 0 0 0
  36.     if rc~=0 then say rc2
  37.  
  38.     changebrush handle topleft
  39.     if rc~=0 then say rc2
  40.  
  41.     circle 20 20 3 painttool brush mode color strength 100
  42.     if rc~=0 then say rc2
  43.  
  44.     get stem pinfo. pictureinfo
  45.     rectangle 0 0 pinfo.width pinfo.height pt fill mode blur strength 100
  46.     rectangle 0 0 pinfo.width pinfo.height pt fill mode blur strength 100
  47.     rectangle 0 0 pinfo.width pinfo.height pt fill mode blur strength 100
  48.  
  49.     if a.number = 1 then
  50.         layer mergewith 2
  51.     else
  52.         layer mergewith 3
  53.     if rc~=0 then say rc2
  54. end
  55. else
  56.     requestnotify 'Too many layers!|Unable to cast shadow.'
  57.  
  58.